﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Andy.Web.TrangChu" %>

<%@ Register Assembly="vdc_AJAXPage" Namespace="VdcInc" TagPrefix="vajax" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" style='<%= IsColor() %>'>
<head runat="server">
    <title>
        <asp:Literal runat="server" ID="ltrTitle"></asp:Literal>
    </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link href="Files/fonts-min.css" rel="stylesheet" type="text/css">
    <link href="Files/grids-min.css" rel="stylesheet" type="text/css">
    <link href="Files/reset-min.css" rel="stylesheet" type="text/css">
    <link href="Files/base-min.css" rel="stylesheet" type="text/css">
    <link href="Files/Base.css" rel="stylesheet" type="text/css">
    <!--[if IE]>
  <link href="http://sioshop.com/skin/default/Assets/Css/IE/IE.css" rel="stylesheet" type="text/css" />
<![endif]-->
    <!--[if lte IE 8]>
  <link href="http://sioshop.com/skin/default/Assets/Css/IE/IELTE8.css" rel="stylesheet" type="text/css" />
<![endif]-->
    <!--[if lte IE 7]>
  <link href="http://sioshop.com/skin/default/Assets/Css/IE/IELTE7.css" rel="stylesheet" type="text/css" />
<![endif]-->
    <!--[if IE 6]>
  <link href="http://sioshop.com/skin/default/Assets/Css/IE/IE6.css" rel="stylesheet" type="text/css" />
<![endif]-->
    <link href="Files/Form.css" rel="stylesheet" type="text/css" />
    <link href="Files/Utils.css" rel="stylesheet" type="text/css" />
    <%--<link rel="stylesheet" type="text/css" href="Files/jquery-ui.css" />--%>
    <script src="Files/ga.js" async="" type="text/javascript"></script>
    <script src="Files/all.js" id="facebook-jssdk"></script>
    <script src="Files/jquery_004.js" type="text/javascript"></script>
    <script type="text/javascript" src="Files/jquery-ui.js"></script>
    <script type="text/javascript" src="Files/jquery_005.js"></script>
    <%--<script type="text/javascript" src="Files/jquery_003.js"></script>--%>
    <script src="Files/Base.js" type="text/javascript"></script>
    <script src="Files/Utils.js" type="text/javascript"></script>
    <script type="text/javascript" src="Files/Track.js"></script>
    <script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
    <link href="Files/Page.css" rel="stylesheet" type="text/css">
    <link href="Files/ProductList.css" rel="stylesheet" type="text/css">
    <%--<script src="Files/ProductList.js" type="text/javascript"></script>--%>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <%--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>--%>
    <%--<script type="text/javascript" src="Files/core.js"></script>--%>
    <script type="text/javascript" src="js/jquery.realperson.js"></script>
    <link rel="stylesheet" href="css/jquery.realperson.css">
    <link href="Files/popup.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="Files/slide.css" media="screen" />


    <link href="Files/ProductList.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="Files/jquery_006.js"></script>
    <script type="text/javascript" src="Files/functions.js"></script>

    <!-- Add fancyBox main JS and CSS files -->
    <%--script type="text/javascript" src="Files/jquery_002.js"></script>--%>
    <link rel="stylesheet" type="text/css" href="Files/jquery_002.css" media="screen">

    <!-- Add Button helper (this is optional) -->
    <link rel="stylesheet" type="text/css" href="Files/jquery.css">
    <%--<script type="text/javascript" src="Files/jquery.js"></script>--%>

    <script type="text/javascript" src="Files/pinit.js"></script>
    <script type="text/javascript" src="Files/functions.js"></script>


    <style type="text/css">
        label {
            display: inline-block;
            width: 20%;
        }

        .realperson-challenge {
            display: inline-block;
        }

        .fancybox-wrap {
            top: 45px !important;
        }
    </style>
    <style type="text/css">
        .designer .info .shop ul.scroll {
            max-height: 165px !important;
        }

        .share {
            width: 436px;
        }

        .lens {
            opacity: 0.2;
        }

        #header .menu li div, #footer .menu li div {
            line-height: 16px !important;
        }

        li.saleRed a {
            color: #ff0000 !important;
        }

            li.saleRed a:hover {
                color: #000000 !important;
            }

        .view-all {
            float: right;
            font-size: 1.2em;
            margin-top: -14px;
        }

            .view-all a {
                text-decoration: none;
                color: #000;
            }

            .view-all strong:before {
                content: 'View All ';
            }

            .view-all strong:after {
                content: ' ';
            }
    </style>

    <script type="text/javascript">
        function loadDialog(a) {
            ob_post.AddParam('idsanpham', a);
            $("input[id$='hdfIdSanPham']").val(a);
            ob_post.post(null, "loadDialogChiTiet", ResultCapNhat);

        }
        function loadDialogBinhLuan(a) {
            $("input[id$='hdfIdBinhLuanCha']").val(a);
            $("#dialog-binhluan").dialog("open");
        }
        function ResultCapNhat(result, ex) {
            $("textarea[id$='faqs_content1']").val('Câu hỏi của bạn...');
            //Load lại capcha
            $("div[class='realperson-regen']").click();
            $("#dialog-form").dialog("open");
        }

        function ValidateBinhLuan()
        {
            var txtnoidung = $("textarea[id$='faqs_content1']").val();
            if (txtnoidung == 'Câu hỏi của bạn...') {
                alert('Chưa nhập nội dung');
                return false;
            }
            if (txtnoidung == '') {
                alert('Chưa nhập nội dung');
                return false;
            }
            if (txtnoidung.length > 1000) {
                alert('Nội quá dài . Tối đa cho phép 1000 kí tự');
                return false;
            }
            //var reCharVN = /^[a-zA-Z0-9ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚĂĐĨŨƠàáâãèéêìíòóôõùúăđĩũơƯĂẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼỀỀỂưăạảấầẩẫậắằẳẵặẹẻẽềềểỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪễệỉịọỏốồổỗộớờởỡợụủứừỬỮỰỲỴÝỶỸửữựỳỵỷỹ ]+$/;
            //if (!reCharVN.test(txtnoidung)) {
            //    alert('Nội dung sai định dạng (Tên nhóm dài 1-50 ký tự, chỉ cho phép ký tự số và chữ có dấu)!');
            //    return false;
            //}
            SubmitBinhLuan();
        }
        function SubmitBinhLuan() {
            var txtnoidung = $("textarea[id$='faqs_content1']").val();
            var idsanpham = $("input[id$='hdfIdSanPham']").val();
            var txt = $("input[name$='defaultReal']").val();
            var txtHash = $("input[name$='defaultRealHash']").val();
            ob_post.AddParam('txtNoiDung', txtnoidung);
            ob_post.AddParam('idsanpham', idsanpham);
            ob_post.AddParam('txtCapcha', txt);
            ob_post.AddParam('txtHashCapcha', txtHash);
            ob_post.post(null, "InsertBinhLuan", ResultSubmitBinhLuan);
        }
        function ResultSubmitBinhLuan(result, ex) {
            if (result != '') {
                alert(result);
                $("div[class='realperson-regen']").click();
                $("textarea[id$='faqs_content1']").val('');
            }
        }

        function SubmitTraLoi() {
            var txtnoidung = $("textarea[id$='txtTraLoi']").val();
            var idsanpham = $("input[id$='hdfIdSanPham']").val();
            var idbinhluancha = $("input[id$='hdfIdBinhLuanCha']").val();
            ob_post.AddParam('txtNoiDung', txtnoidung);
            ob_post.AddParam('idsanpham', idsanpham);
            ob_post.AddParam('idbinhluancha', idbinhluancha);
            ob_post.post(null, "InsertTraLoi", ResultSubmitTraLoi);
            $("#dialog-binhluan").dialog("close");
        }
        function ResultSubmitTraLoi(result, ex) {
            if (result != '') {
                alert(result);
            }
        }
        function paging(page) {
            var idsanpham = $("input[id$='hdfIdSanPham']").val();
            ob_post.AddParam('idsanpham', idsanpham);
            ob_post.AddParam('currPage', page);
            ob_post.post(null, "loadBinhLuan", ResultloadBinhLuan);
        }

        function pagingLeft(page) {
            ob_post.AddParam('currPage', page);
            ob_post.post(null, "loadBinhLuanLeft", ResultloadBinhLuan);
        }
        function paging_sp(page) {
            ob_post.AddParam('currPage', page);
            ob_post.post(null, "loadSanPham", ResultloadBinhLuan);
        }
        function ResultloadBinhLuan(result, ex) {
        }

        function XoaBinhLuan(id) {
            var answer = confirm("Bạn có chắc muốn xóa bình luận này ko ?")
            if (answer) {
                var idsanpham = $("input[id$='hdfIdSanPham']").val();
                ob_post.AddParam('idsanpham', idsanpham);
                ob_post.AddParam('strBinhLuanId', id);
                ob_post.post(null, "vXoabinhLuan", ResultXoaBinhLuan);
            }
        }
        function ResultXoaBinhLuan(result, ex) {
            alert(result);
        }
        $(function () {
            $("#dialog-form").dialog({
                autoOpen: false,
                width: 817,
                resizable: false,
                close: function () {
                    // alert('close');
                    location.reload();
                }
            });
            $("#dialog-binhluan").dialog({
                autoOpen: false,
                width: 200,
                resizable: false,
                close: function () {
                    // alert('close');
                }
            });
            $('#defaultReal').realperson({
                length: 4, // Number of characters to use 
                includeNumbers: false, // True to use numbers as well as letters 
                regenerate: '<img src="Images/reload.gif">'
            });

        });


    </script>

</head>
<body id="body" class="mens matches-fashion content-detail-mens-justin-last-21-days" style='<%= IsColor() %>'>

    <form id="form1" runat="server">
        <div id="container">
            <div id="header">
                <div id="headerNav">
                    <div class="site-links">
                        <h1><a href="Default.aspx" class="matches" title="">
                            <img src="" runat="server" id="Img_banner" width="245" height="50" /></a></h1>
                    </div>
                    <div class="dept-links"></div>
                    <div class="dept-links" style="position: relative !important;">
                        <ul class="menu" id="navigation">
                            <li><a href="#">Giới thiệu</a></li>
                            <li><a href="Default.aspx" class="active">Giày</a>
                            </li>
                            <li><a href="HuongDan.aspx">HD mua hang</a></li>
                        </ul>
                    </div>
                </div>
            </div>



            <div class="sub-header">
                <h3 class="banner">
                    <asp:Literal runat="server" ID="ltrTitleBanner"></asp:Literal>
                </h3>
            </div>

            <div id="content">

                <div style="visibility: visible;" class="tree">



                    <div class="tree-list">

                        <asp:Repeater runat="server" ID="RptMenuLoaiSanPham">
                            <ItemTemplate>
                                <div class="v-panels">
                                    <div data-closed="" class="branch characteristic-branch cols-1 designer closed">
                                        <h4 class="tab"><span><a href="?loai=<%#Eval("ID") %>" style="text-decoration: none;"><%#Eval("Ten") %></a></span></h4>
                                    </div>
                                </div>
                            </ItemTemplate>
                        </asp:Repeater>

                    </div>

                    <h3><strong>Chat Yahoo</strong></h3>
                    <a href="ymsgr:sendIM?tieu_diem_vuong2004" class="yahoo offline" id="tieu_diem_vuong2004" rel="tieu_diem_vuong2004">&nbsp;</a><br>


                    <br />

                    <div style="display: none">
                        <img id="fbProfilePicture" />
                    </div>
                    <iframe src="" scrolling="no" frameborder="0" style="border: none; overflow: hidden; width: 200px; height: 258px;" allowtransparency="true"></iframe>
                    <br>
                    <br>
                    <br>
                    <!-- faqs -->
                    <h2 style="margin: 0 !important;">BÌNH LUẬN MỚI</h2>
                    <div id="wrapfaqs">
                        <ul class="commentList albumFeedbackForm">
                            <vajax:CallbackPanel ID="cpbBinhLuan_left" runat="server">
                                <Content>
                                    <asp:Repeater runat="server" ID="lstBinhLuan">
                                        <ItemTemplate>
                                            <li class="odd question">
                                                <p>
                                                    <span class="question_text" style="font-weight: bold;"><%#Eval("Loai") %>:&nbsp;</span><%#Eval("NoiDung") %><em>(<%# Convert.ToDateTime(Eval("ThoiGian")).ToString("HH:mm dd/MM") %>)</em>&nbsp;
                                                </p>
                                                <div class="answer" style="margin-bottom: 2px">
                                                    <p>
                                                        <a href="#null" onclick="loadDialog(<%#Eval("SanPhamId") %>)"><%#Eval("SanPhamTen") %></a>
                                                    </p>
                                                </div>
                                            </li>
                                        </ItemTemplate>




                                    </asp:Repeater>
                                </Content>
                            </vajax:CallbackPanel>


                        </ul>
                        <ul class="pages clearfix">
                            <vajax:CallbackPanel ID="cbpPhanTrang_left" runat="server">
                                <Content>
                                    <asp:Literal ID="ltrPhanTrang_left" runat="server"></asp:Literal>
                                </Content>
                            </vajax:CallbackPanel>
                        </ul>

                    </div>
                    <a href="HuongDan.aspx" style="margin-top: 2px;">
                        <img runat="server" src="" id="imgMuaHang" width="200" height="300" />

                    </a>


                </div>





                <style>
                    .jquery-slider-selectors {
                        bottom: 10px !important;
                    }
                </style>
                <div class="products-list">
                   <%-- <div style="width: 755px !important; display: block">
                        <div style="width: 740px; height: 300px;" class="jquery-slider-wrapper jquery-slider-option-navigation-selector-control-timer">--%>

                            <asp:PlaceHolder runat="server" ID="plHolder"></asp:PlaceHolder>
                        <%--</div>
                    </div>--%>
                    <div class="top-menu">
                        <%--<ul class="breadcrumb">
                            <li><a href="http://sioshop.com/">Trang chủ</a>&nbsp;/&nbsp;</li>
                            <li><a href="http://sioshop.com/product.html">Sản phẩm</a>&nbsp;/&nbsp;</li>
                            <li><a href="javascript:void(0)">Giày casual</a></li>
                        </ul>--%>

                        <div class="drop-downs" style="display: none;">
                            <form action="" method="get" novalidate="novalidate">
                                <select style="" name="orderby" id="orderby">
                                    <option selected="selected" value="">Sắp xếp theo</option>
                                    <option value="justin">Mới nhất</option>
                                    <option value="alphabetically">A-Z</option>
                                    <option value="pricelowhigh">Giá (thấp - cao)</option>
                                    <option value="pricehighlow">Giá (cao - thấp)</option>
                                </select>
                                <input value="Go" style="display: none;" type="submit">
                            </form>
                        </div>
                    </div>
                    <div class="products">
                        <vajax:CallbackPanel ID="cbpDanhSachSanPham" runat="server">
                            <Content>
                                <asp:ListView runat="server" ID="lvDanhSach">
                                    <ItemTemplate>
                                        <div class="product medium product-relative">
                                            <a href="#null" onclick="loadDialog(<%#Eval("Id") %>)">
                                                <div class="image">
                                                    <img src='<%#Eval("Anh") %>' class="product-image" title="" alt="">
                                                </div>
                                                <div class="tensanpham">
                                                    <%#Eval("Ten") %>
                                                </div>
                                                <div class="binhluan">
                                                    <%#Eval("TongSoBinhLuan") %> bình luận
                                                </div>
                                            </a>
                                        </div>
                                    </ItemTemplate>
                                </asp:ListView>
                            </Content>
                        </vajax:CallbackPanel>
                    </div>
                    <ul class="pages clearfix">
                        <vajax:CallbackPanel ID="cbpPhanTrangSP" runat="server">
                            <Content>
                                <asp:Literal ID="ltrPhanTrangSP" runat="server"></asp:Literal>
                            </Content>
                        </vajax:CallbackPanel>
                    </ul>
                    <div class="bottom-menu"></div>

                </div>
            </div>


            <div id="footer">
                <div id="footerNav">
                    <div class="menus">
                    </div>

                </div>
                <div id="footerText">
                    <div class="info">
                        <span class="mission-snippet"></span>
                        <p>Power by <a href="http://dantri.com/" target="_blank">©</a></p>
                    </div>
                    <script type="text/javascript" src="Files/pinit.js"></script>

                </div>
            </div>

        </div>




        <script type="text/javascript">
            jQuery(window).bind("load", function () {
                var fbpicUrl = "http://graph.facebook.com/100001225080368/picture";
                jQuery('#fbProfilePicture').attr("src", fbpicUrl);
                setTimeout(function () {
                    var img = jQuery('#fbProfilePicture')[0];
                    if (img.naturalWidth == 0) {
                        jQuery('#fbProfilePicture').removeAttr('src');
                    }
                    else {
                        jQuery('iframe').each(function (i, value) {
                            var url = "//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FTungAndyShop-GI%25C3%2580Y-NAM%2F138322399677228%3Ffref%3Dts&amp;width=200&amp;height=258&amp;show_faces=true&amp;colorscheme=light&amp;stream=false&amp;show_border=true&amp;header=false";
                            value.src = url;
                        });
                    }
                }, 5000);
            });
        </script>

        <div id="dialog-form">
            <div id="enquiry" class="clearfix">
                <!--begin stageWrapper-->
                <div class="stageWrapper">
                    <div class="stage">
                        <vajax:CallbackPanel ID="cbpAnhChinh" runat="server">
                            <Content>
                                <img runat="server" id="imgChinh" alt="Mix for style" width="400">
                            </Content>
                        </vajax:CallbackPanel>
                        
                        <asp:HiddenField runat="server" ID="hdfIdSanPham" />
                        <asp:HiddenField runat="server" ID="hdfIdBinhLuanCha" />
                    </div>
                    <div class="tensanpham">
                            <vajax:CallbackPanel ID="cbpTen" runat="server">
                                <Content>
                                    <label id="TenSanPham" runat="server"></label>
                                </Content>
                            </vajax:CallbackPanel>
                        </div>
                        <div class="binhluan">
                            <vajax:CallbackPanel ID="cbpGia" runat="server">
                                <Content>
                                    <label id="GiaSanPham" runat="server"></label>
                                </Content>
                            </vajax:CallbackPanel>
                        </div>
                    <div class="price">
                        <p style="font-size: 14px;">
                            <strong style="color: red;">Địa chỉ:</strong>
                            <asp:Literal runat="server" ID="ltrTitleChiTiet"></asp:Literal>
                            <h5>
                                <label runat="server" id="lbTest"></label>
                            </h5>
                        </p>
                    </div>
                </div>
                <!--end stageWrapper-->
                <!--begin photoSnowlift-->
                <div class="photoSnowlift">
                    <div class="timelineUnitRoot clearfix">
                    </div>
                    <!--begin commentList-->

                    <div style="margin-left: 10px;">
                        <h2 style="margin: 0 !important;">Hỏi đáp nhanh</h2>
                        <textarea id="faqs_content1" style="width: 388px; height: 30px !important" onblur="this.value=(this.value=='') ? 'Câu hỏi của bạn...' : this.value;" onfocus="this.value=(this.value=='Câu hỏi của bạn...') ? '' : this.value;">Câu hỏi của bạn...</textarea>
                        <div>
                            <p style="color: #999999; font-size: 11px; margin: 0 !important;" id="faqs_msg1">Nhập mã bảo vệ bên dưới:</p>
                            <%--<input style="padding: 2px; width: 74px; margin: 5px 0px;" id="faqs_captcha1" type="text">--%>
                            <asp:TextBox ID="defaultReal" runat="server"></asp:TextBox>
                            <%--<input name="submit" value="Gửi" style="padding: 2px; width: 50px; margin: 0 !important;" onclick="SubmitBinhLuan()" type="button">--%>
                            <asp:Button ID="btSubmit" runat="server" Style="padding: 2px; width: 50px; margin: 0 !important;" Text="Gửi" OnClientClick="return ValidateBinhLuan();" />
                        </div>
                        <div class="clearfix"></div>
                        <div id="fancybox_wrapfaqs" class="fancybox_wrapfaqs">
                            <ul class="commentList albumFeedbackForm">
                                <vajax:CallbackPanel ID="cbpBinhluan" runat="server">
                                    <Content>
                                        <asp:ListView runat="server" ID="lvBinhLuan">
                                            <ItemTemplate>
                                                <li class="odd question">
                                                    <p><span class="question_text" style="font-weight: bold;"><%#Eval("Loai") %> :&nbsp;</span><%#Eval("NoiDung") %><em>(<%# Convert.ToDateTime(Eval("ThoiGian")).ToString("HH:mm dd/MM") %>)</em>&nbsp;</p>
                                                    <%--<p><a href="#null" onclick="loadDialogBinhLuan(<%#Eval("Id") %>);">Trả lời</a></p>--%>
                                                    <%# (Session["nsd"] as Andy.Web.NguoiDungServiceReference.NguoiDung !=null && Convert.ToInt64(Eval("IdBinhLuanCha"))==0) ? Eval("Id","<p><a href='#null' onclick='loadDialogBinhLuan({0});'>Trả lời</a></p>")  : "<p></p>" %>
                                                    <%# (Session["nsd"] as Andy.Web.NguoiDungServiceReference.NguoiDung !=null) ? Eval("Id","<p><a href='#null' onclick='XoaBinhLuan({0});'>Xóa</a></p>")  : "<p></p>" %> 
                                                </li>
                                            </ItemTemplate>
                                        </asp:ListView>
                                    </Content>
                                </vajax:CallbackPanel>
                            </ul>
                            <ul class="pages clearfix">
                                <vajax:CallbackPanel ID="cbpPTBinhLuan" runat="server">
                                    <Content>
                                        <asp:Literal ID="ltlPhanTrang" runat="server"></asp:Literal>
                                    </Content>
                                </vajax:CallbackPanel>
                            </ul>
                        </div>

                    </div>

                </div>
            </div>
        </div>
        <div id="dialog-binhluan">
            <span id="spBinhLuan"></span>
            <asp:TextBox TextMode="MultiLine" runat="server" ID="txtTraLoi"></asp:TextBox>
            <asp:Button Text="Lưu" runat="server" OnClientClick="return SubmitTraLoi();" />
        </div>
    </form>
</body>
</html>
